
package com.gome.gop.common;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.StringUtils;

/**
 *
 * @Title:
 * @Description:编号前缀类型
 * @Author:12944
 * @Since:2019/11/28 17:09
 * @Copyright:Copyright (c) 2018 - 2100
 * @Company:gome
 * @Version:1.1.0
 */
public enum SerialPrefixEnum {
    // 安装单前缀
    INSTALL_PREFIX("MO"),
    INSTALL_TASK_PREFIX("IAX")

    ;
    
    public static List<String> getNameList() {
        SerialPrefixEnum[] documentTypes = SerialPrefixEnum.values();
        List<String> list = new ArrayList<String>();
        for (SerialPrefixEnum documentType : documentTypes) {
            list.add(documentType.toString().toUpperCase());
        }
        return list;
    }
    
    public static List<String> getValueList() {
        SerialPrefixEnum[] documentTypes = SerialPrefixEnum.values();
        List<String> list = new ArrayList<String>();
        for (SerialPrefixEnum documentType : documentTypes) {
            list.add(documentType.getValue().toString().toUpperCase());
        }
        return list;
    }
    
    private String value;
    
    private SerialPrefixEnum(String value) {
        this.value = value;
    }
    
    public String getValue() {
        return value;
    }
    
    public void setValue(String value) {
        this.value = value;
    }
    
    public static SerialPrefixEnum getEnumByValue(String value) {
        for (SerialPrefixEnum userAccountEnum : SerialPrefixEnum.values()) {
            if (StringUtils.equals(value, userAccountEnum.getValue())) {
                return userAccountEnum;
            }
        }
        return null;
    }
    
    public static void main(String[] args) {
    }
}
